/*
 * Alexey Danchuk
 * This software is an implementation of the task from OOP module.
 */
package question;

/**
 * This class describes basics issues about our presentation of question.
 *
 * @version 2.03 10 February 2013
 * @author Alexey Danchuk
 */
public abstract class Question {

    /**
     * This variable holds question text.
     */
    private String question;
    /**
     * This variable holds answers array.
     */
    private String answerVariants;
    /**
     * This variable holds the correct answer to the question.
     */
    private String correctAnswer;

    /**
     * Method to check answers with special algorithm which is different for our
     * questions type.
     *
     * @param userAnswers - inputed answers from user
     * @return - plus one point to the overall user mark
     */
    public abstract int chekAnswer(String userAnswers);

    protected void saveQuestion(final String questionText,
            final String answerVariantsText,
            final String correctAnswers) {
        inputQuestionText(questionText);
        inputAnswerVariants(answerVariantsText);
        saveCorrectAnswer(correctAnswers);
    }

    public final String getAnswerVariants() {
        return answerVariants;
    }

    public final String getQuestion() {
        return question;
    }

    private void saveCorrectAnswer(final String answers) {
        correctAnswer = answers;
    }

    private void inputQuestionText(final String questionText) {
        question = questionText;
    }

    private void inputAnswerVariants(final String answersVariantsText) {
        answerVariants = answersVariantsText;
    }
}
